package l.l.w.UnderstandingJVM.GC.testGC1;

import org.omg.PortableInterceptor.INACTIVE;

import java.util.LinkedList;
import java.util.List;

/**
 * Created by llw on 2017/11/9.
 */
public class SubListDemo {
    public static void main(String[] args) {
        LinkedList<Integer> list = new LinkedList<>();
        list.add(1);
        list.add(2);
        list.add(3);
        list.add(4);
        List<Integer> subList = list.subList(1, 3);
        System.out.println(subList);
        subList.add(7);
        System.out.println("list:"+list);
        System.out.println("subList:" + subList);
        list.add(8);
        System.out.println("list:"+list);
        System.out.println("subList:" + subList);


    }
}
